<?php


namespace app\api\model;


class Book extends Base
{
    protected $autoWriteTimestamp = 'datetime';

    //隐藏字段
    protected $hidden = [
        "create_time","update_time","user_id","user",
    ];

    //关联User信息表
    public function user()
    {
        return $this->belongsTo('User','user_id');
    }

    //管理label表
    public function label() {
        return $this->belongsTo('Label','label');
    }

}